<?php
require('lib/xmlrpc.inc');
function xmlrpc_debug($message) {
    $xmlrpc_internalencoding = 'UTF-8';
    $handle = new xmlrpc_client('/','localhost',8888);
    $path_parts = pathinfo($_SERVER['PHP_SELF']);
    $file_path = $path_parts["dirname"]."/".$path_parts["basename"];
    $message = "[".$file_path."]".$message;
    $msg = new xmlrpcmsg('debug',array(php_xmlrpc_encode($message)));
    $rsp = $handle->send($msg);
    if ($rsp->faultcode() == 0) {
        $response = php_xmlrpc_decode($rsp->value());
    }
    else {
        print $rsp->faultcode().'------>'.$rsp->faultstring(); 
    }
}
function debug($classname,$func,$line,$message) {
    xmlrpc_debug(" [".$classname." ".$func.":".$line."] ".$message);
}
?>
